<?php

namespace Home\Model\Ajax;

class Toploginform extends AbstractAjax
{
    public function handle()
    {
        $user = D('User');
        if ($user->is_login()) {
            $str  = '欢迎&nbsp;&nbsp;' . session('ytata.username') . '&nbsp;&nbsp;登录！ <span><a href="' . RU('user/index') . '">进入会员中心</a></span><span><a href="Javascript:void(0)" class="J_user_logout">退出</a></span>';
            $html = $str;
        } else {
            $str1 = '欢迎登录 ' . C('YTATA_SITE_NAME') . '！请 <span><a href="Javascript: void(0)" class="J_user_login">登录</a></span>或<span><a href="Javascript: void(0)" class="J_user_reg">注册</a></span>';
            $html = $str1;
        }
        $ajax['status']  = 1;
        $ajax['content'] = $html;
        return $ajax;
    }
}